package com.briup.cms.service.impl;

import com.briup.cms.bean.Notes;
import com.briup.cms.dao.NotesMapper;
import com.briup.cms.service.INotesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class INotesServiceImpl implements INotesService {
@Resource
private NotesMapper notesMapper;
    @Override
    public List<Notes> findAll() {
        return notesMapper.selectAll();
    }

    @Override
    public void saveOrUpdate(Notes notes) {
        if ((notes.getId() != null)) {
            notesMapper.insert(notes);
        } else {
            notesMapper.update(notes);
        }
    }

    @Override
    public void deleteById(long id) {
        notesMapper.deleteById(id);
    }
}
